package com.shan;

/**
 * @Author: ShanYuqing
 * @Version: v1.0
 */
public class forTest {
    public static void main(String[] args) {
        //生成方法返回值快捷键：方法名（）.var+回车
//        sum();
//        System.out.println("---------");
//        int sum = getSum();
//        System.out.println("ssss" + sum);
        jiujiu();
    }

    //需求：循环1~100之间的偶数和，并把求和打印在控制台
    public static void sum() {
        int sum = 0;
        for (int i = 1; i <= 100; i++) {
            if (i % 2 == 0) {
                sum += i;
            }

        }
        System.out.println(sum);
    }

    public static int getSum() {
        int sum = 0;
        for (int i = 2; i <= 100; i += 2) {
            sum += i;
        }
        return sum;
    }

    public static void jiujiu() {

        for (int i = 1; i <= 9; i++) {
            for (int j = 1; j <= i; j++) {
                    System.out.print(j+"*"+i+"="+j*i+"\t");
            }
            System.out.println();
        }
    }
}
